package cn.edu.sdjzu.xg.eagle.hairsalon.service.impl;

import com.cn.edu.sdjzu.xg.eagle.hairsalon.utils.PageUtils;
import com.cn.edu.sdjzu.xg.eagle.hairsalon.utils.Query;


import com.cn.edu.sdjzu.xg.eagle.hairsalon.dao.FuwuyuyueDao;
import com.cn.edu.sdjzu.xg.eagle.hairsalon.entity.FuwuyuyueEntity;
import com.cn.edu.sdjzu.xg.eagle.hairsalon.service.FuwuyuyueService;
import com.cn.edu.sdjzu.xg.eagle.hairsalon.entity.view.FuwuyuyueView;

import java.util.List;
import java.util.Map;

@Service("fuwuyuyueService")
public class FuwuyuyueServiceImpl extends ServiceImpl<FuwuyuyueDao, FuwuyuyueEntity> implements FuwuyuyueService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<FuwuyuyueEntity> page = this.selectPage(
                new Query<FuwuyuyueEntity>(params).getPage(),
                new EntityWrapper<FuwuyuyueEntity>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<FuwuyuyueEntity> wrapper) {
        Page<FuwuyuyueView> page =new Query<FuwuyuyueView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<FuwuyuyueView> selectListView(Wrapper<FuwuyuyueEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public FuwuyuyueView selectView(Wrapper<FuwuyuyueEntity> wrapper) {
        return baseMapper.selectView(wrapper);
    }




}